#!/usr/bin/perl

# Copyright (c) 2008 Torsten Werner <twerner@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA

=head1 NAME

libnxml-depends - calculates dependencies for the libnxml library

=cut

use strict;
use warnings;
use Debian::Debhelper::Dh_Lib;

=head1 SYNOPSIS

B<libnxml-depends> [S<I<debhelper options>>]

=head1 DESCRIPTION

libnxml-depends is a debhelper-like program that is responsible for
generating the ${libnxml-abi:Depends} substitutions and adding them to
substvars files.

If you use this program, your package must build-depend on libnxml-dev
(>= 0.18.1-4).

=head1 USAGE

- call libnxml-depends in debian/rules before dh_gencontrol is called

- add a new Depends: ${libnxml-abi:Depends} in all binary packages
that already depend on libnxml0 (via ${shlibs:Depends}) 

=cut

init ();

# The current libnxml version
my $version = '@VERSION@';

foreach my $package (@{$dh{DOPACKAGES}}) {
  delsubstvar($package, "libnxml-abi:Depends");
  addsubstvar($package, "libnxml-abi:Depends", "libnxml-abi-$version");
}

=head1 SEE ALSO

L<debhelper(7)>

This program is not part of debhelper.

=head1 AUTHOR

Varun Hiremath <varun@debian.org>
Torsten Werner <twerner@debian.org>

Most ideas are borrowed from octave-depends by Rafael Laboissiere
<rafael@debian.org>.

=cut
